<style>
    #menu-icon-show{
        display: inline-block;
        width: 30px;
        height: 30px;
        line-height: 30px;
        text-align: center;
        font-size: 20px;
    }
</style>
<div class="sm-pop">
    <div id="dialog_form" class="layui-form">
        <div class="layui-input-block" style="display: none">
            <input type="hidden" id="menuId" name="menuId" value="<%=menuId%>">
        </div>
        <div class="layui-input-block" style="display: none">
            <input type="hidden" name="parentId" value="<%=parentId%>">
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i>*</i> 菜单名称</label>
            <div class="layui-input-block">
                <input type="text" name="menuName" maxlength="50" lay-verify="required" placeholder="请输入菜单名称"
                       class="layui-input" value="<%=menuName%>">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i>*</i> 菜单类型</label>
            <div class="layui-input-block">
                <select id="menuTypeList" name="menuType" lay-verify="required">
                    <option value="">请选择菜单类型</option>
                    <option value="1" <%=menuType=="1"?"selected":""%>>菜单</option>
                    <option value="2" <%=menuType=="2"?"selected":""%>>功能</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i>*</i> 菜单排序</label>
            <div class="layui-input-block">
                <input type="text" name="orderNum"  maxlength="11"  lay-verify="required|number"
                       placeholder="请输入菜单排序" class="layui-input" value="<%=orderNum%>">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i>*</i> 菜单状态</label>
            <div class="layui-input-block">
                <select id="status" name="status" lay-verify="required">
                    <option value="">请选择菜单状态</option>
                    <option value="0" <%=status=="0"?"selected":""%> >启用</option>
                    <option value="1" <%=status=="1"?"selected":""%> >禁用</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">url链接</label>
            <div class="layui-input-block">
                <input type="text" name="url" maxlength="200" placeholder="请输入url链接" class="layui-input"
                       value="<%=url%>">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">菜单图标</label>
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal layui-btn-sm" id="menu-icon">选择</button>
                <i class="iconfont <%=icon%>" id="menu-icon-show"></i>
                <input type="hidden" name="icon" id="menu-icon-save" value="<%=icon%>">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="remark" maxlength="100" placeholder="请输入备注"
                          class="layui-textarea"><%=remark%></textarea>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form'], function () {
        $("#menu-icon").click(function () {
            smartAui.dialog({
                title: '选择',
                template: 'icon',
                btn: false,
                success: function (index, layero) {
                    $("#menu-icon-pop").on("click", "span", function () {
                        var $icon = $(this);
                        $icon.removeClass("icon").removeClass("iconfont");
                        var name = $icon.attr("class");
                        $("#menu-icon-show").attr("class", "iconfont " + name);
                        $("#menu-icon-save").val(name);
                        layer.close(index);
                    });
                }
            });
        });
    })
</script>